define(['vue','common','layer'],function (Vue,common,layer){
    const Controller = {
        index:function (){
            let {createApp} = Vue;
            let app = createApp({
                data(){
                    return {
                        select:"0",
                        type:'',
                        multiple:"0",
                        //列表数据
                        listObj:{
                            listType:"tree",
                            page:1,
                            limit:10,
                            total:0,
                            list:[]
                        },
                        //搜索条件
                        search:{
                            list:[],
                            form:{}
                        },
                        //批量选择
                        selectables:[]
                    }
                },
                created(){
                    this.getList()
                    // console.log(location.search,'ssssssssssssss')
                    let param = common.windowsGetParams(true)
                    if(param.select){
                        this.select = param.select
                    }
                    if(param.type){
                        this.type = param.type
                    }
                    if(param.multiple){
                        this.multiple = param.multiple
                    }

                    // console.log(param,'ssssssssssssss')
                },
                methods:{
                    ...common,
                    handleDownload(e){
                        let url = e.url
                        if(this.multiple==1){

                        }else{
                            parent.callback(url)
                            common.close()
                        }

                    }
                }
            })
            common.load(app,['icon'])
            app.mount('#app')
        },
        add:function (){
            let {createApp} = Vue;
            let app = createApp({
                data(){
                    return {
                        //表单数据
                        form:{
                            url:""
                        },
                        //表单验证
                        rules:{},
                        param:{}
                    }
                },
                created() {
                    if(Config.param){
                        this.param = Config.param
                    }
                },
                methods:{
                    ...common,
                    handSuccess(response, uploadFile, uploadFiles){
                        this.close()
                    }
                }
            })
            common.load(app,['MuFileUpload'])
            app.mount('#app')
        }
    }
    return Controller;
})